package com.tienon.message.Test;


import java.util.ArrayList;
import java.util.List;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;


import com.tienon.message.entity.Raw_msg_batch;
import com.tienon.message.thread.LoadRawMsgTasks;

public class TestLoadTasks {

	public static void main(String[] args) throws InterruptedException, ExecutionException {
		
		//单个
		Future<Boolean> result = null;
		Raw_msg_batch data = new Raw_msg_batch();
		result = LoadRawMsgTasks.loadRawMsgTask(data);
		
		System.out.println(result.get());
		//批次
		List<Future<Boolean>> results = null;
		
		
		List<Raw_msg_batch> datas = new ArrayList<Raw_msg_batch>(); 
		for(int i = 0;i<100;i++){
			
			datas.add(new Raw_msg_batch());
			
		}
		
		results = LoadRawMsgTasks.loadRawMsgTasks(datas);
		for(Future<Boolean> r : results){
			System.out.println(r.get());
		}
		
		LoadRawMsgTasks.closeTasks();
		
	}
	
}
